package IC.lir.Instrunction;

import IC.lir.ClassStructure;

public class MemoryAlocationInstruction extends Instruction {
	
	private int _numOfBytes;
	private Register _returnRegister;
	
	public MemoryAlocationInstruction(Register retRegister, int numOfBytes)
	{
		_numOfBytes = numOfBytes;
		_returnRegister = retRegister;
	}

	public MemoryAlocationInstruction(Register retRegister, ClassStructure classStruct)
	{
		this(retRegister, classStruct.GetClassSize() * 4);
	}
	
	public String toString() 
	{ 
		return String.format("Library __allocateObject(%d), %s", _numOfBytes, _returnRegister);
	}
}
